import React from "react";
import { Tag } from "antd";
import { TagType } from "../../types";
import { useStyle } from "./useStyle";

export type TagsType = TagType[];
export type TagListProps = {
  tags: TagsType;
};

const TagList = (props: TagListProps) => {
  const styles = useStyle();
  const { tags } = props;

  return (
    <div css={styles.tagClass}>
      <div className="tagsTitle">权限</div>
      {(tags || []).map((item) => (
        <Tag key={item.key}>{item.label}</Tag>
      ))}
    </div>
  );
};

export default TagList;
